<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.jsp.bean.VehicleBean" %>
<%@ page import="com.jsp.dao.VehicleDao" %>
<%@ page import="com.jsp.util.DBUtil" %>
<%@ page import="java.sql.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'updatevehicle.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  <style> 
  td  
   {  
    text-align:center;  
   }  
  </style>

  </head>
  
  <body background="images/picture_6.jpg">
  <div class="officialcar">
      <center><h1>欢迎进入管理员系统</h1>
      <p>车辆信息</p><br/>
     <table border="1" cellpadding="2" cellspacing="0">  
        <tr>
            <td><b>车牌号</b></td>           
            <td><b>车型</b></td>
            <td><b>出厂日期</b></td>
            <td><b>司机信息</b></td>
            <td><b>状态</b></td> 
            <td><b></b></td>        
       </tr> 
        <%
        int startPage = 0;
        int diePage = 100;  
        List <VehicleBean> list = new ArrayList <VehicleBean>();
        Connection con = DBUtil.getConnection();
        String sql = "select * from Vehicleinformation order by id asc limit ?,?";
        PreparedStatement state = con.prepareStatement(sql);
		state.setInt(1,startPage);
		state.setInt(2,diePage);
        ResultSet rs = state.executeQuery(); 
        while(rs.next()){
        %>
        <tr>
            <form method="post" action="VehicleInformationServlet?mark=update">
            <input type="hidden" name="id" value=<%=rs.getString("id")%>>
            <td><input type="text" name="plateNumber" value=<%=rs.getString("plateNumber")%>></td>
            <td><input type="text" name="models" value=<%=rs.getString("models")%>></td>
            <td><input type="text" name="productDate" value=<%=rs.getString("productDate")%>></td>
            <td><input type="text" name="driverInformation" value=<%=rs.getString("driverInformation")%>></td>
            <td><input type="text" name="state" value=<%=rs.getString("state")%>></td>
            <td><input type="submit" name="update" value="更新"></p></td>
     	    </form>                                                        
        </tr>
        <%}
          state.close();
          con.close();
        %> 
    </table>
    </div> 
    <br>
    <br>
    <div>
         <center><a href="admin/vehicle.jsp"><input name="commit" type="submit" id="back" value="返回"></a>           
   </div>   
  </body>
</html>
